home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ODDocRef.h
-
- Contains: A class for opening OpenDoc documents and drafts in the
- context of the OpenDoc shell.
-
- Owned by: Nick Pilch
-
- Copyright:
-
- Change History (most recent first):
-
- <2> 20.09.1996 NP 1386083: Rewrite document opening code.
- <1> 18.09.1996 NP first checked in
-
- To Do:
- */
-
- #ifndef _ODDOCREF_
- #define _ODDOCREF_
-
-
- #ifndef _ODTYPES_
- #include "ODTypes.h"
- #endif
-
- #ifndef __FILES__
- #include <Files.h>
- #endif
-
- class ODDocument;
- class ODSession;
- class ODDraft;
- class PlatformFile;
- class ODContainer;
-
- class ODOpenDocumentRef
- {
- public:
-
- ODOpenDocumentRef(ODSession* session,
- PlatformFile* document,
- ODDraftPermissions permissions);
- /*
- document is the OpenDoc file to open
- */
- ~ODOpenDocumentRef();
- /*
- Does not close the document! Make sure to call Close first if you have called
- Open.
- */
- ODDraft* Open(Environment* ev);
- /*
- Open the document. If an exception is thrown, the open did not succeed and
- */
- void OpenDraft(Environment* ev, ODDraft* draft);
- /*
- Open a particular draft of a document.
- */
- // void Save(Environment* ev);
- /*
- Save the document
- */
- // void Close(Environment* ev);
- /*
- Close the document. Any changes in the temp draft are thrown out, so you best
- call Save before calling Close if any changes to the doc are to be saved.
- */
- // ODDocument* GetDocument();
- // ODDraft* GetTopDraft();
-
- private:
-
- ODDraft* AcquireCtrDocTopDraft(Environment* ev);
- void DocumentOpened(Environment* ev);
- void AddToRefNumDocNS(Environment* ev);
- void RemoveFromRefNumDocNS(Environment* ev);
- void AddToTempDraftNS(Environment* ev);
- // void RemoveFromTempDraftNS(Environment* ev);
-
- PlatformFile* fFile;
- ODSession* fSession;
- ODDraftPermissions fPermissions;
- ODContainer* fContainer;
- ODDocument* fDocument;
- short fRefNum;
- ODDraft* fTempDraft;
- ODNameSpaceManager* fNameSpaceManager;
- /*
- don't need to store alias or doc ref num
- should store document, session references. (drafts? or get on the fly?)
- */
- };
-
- #endif /* _ODDOCREF_ */
-
-